package FileTransferIRPSystem;


/**
 * Generated from IDL interface "FileTransferIRP".
 *
 * @author JacORB IDL compiler V 2.3.0, 17-Feb-2007
 * @version generated at 2013-5-20 22:07:19
 */

public abstract class FileTransferIRPPOA
	extends org.omg.PortableServer.Servant
	implements org.omg.CORBA.portable.InvokeHandler, FileTransferIRPSystem.FileTransferIRPOperations
{
	static private final java.util.Hashtable m_opsHash = new java.util.Hashtable();
	static
	{
		m_opsHash.put ( "get_file_transfer_irp_versions", new java.lang.Integer(0));
		m_opsHash.put ( "get_file_transfer_irp_notifications_profile", new java.lang.Integer(1));
		m_opsHash.put ( "file_download_indication", new java.lang.Integer(2));
		m_opsHash.put ( "get_file_transfer_irp_operations_profile", new java.lang.Integer(3));
		m_opsHash.put ( "list_available_files", new java.lang.Integer(4));
	}
	private String[] ids = {"IDL:FileTransferIRPSystem/FileTransferIRP:1.0"};
	public FileTransferIRPSystem.FileTransferIRP _this()
	{
		return FileTransferIRPSystem.FileTransferIRPHelper.narrow(_this_object());
	}
	public FileTransferIRPSystem.FileTransferIRP _this(org.omg.CORBA.ORB orb)
	{
		return FileTransferIRPSystem.FileTransferIRPHelper.narrow(_this_object(orb));
	}
	public org.omg.CORBA.portable.OutputStream _invoke(String method, org.omg.CORBA.portable.InputStream _input, org.omg.CORBA.portable.ResponseHandler handler)
		throws org.omg.CORBA.SystemException
	{
		org.omg.CORBA.portable.OutputStream _out = null;
		// do something
		// quick lookup of operation
		java.lang.Integer opsIndex = (java.lang.Integer)m_opsHash.get ( method );
		if ( null == opsIndex )
			throw new org.omg.CORBA.BAD_OPERATION(method + " not found");
		switch ( opsIndex.intValue() )
		{
			case 0: // get_file_transfer_irp_versions
			{
			try
			{
				_out = handler.createReply();
				ManagedGenericIRPConstDefs.VersionNumberSetHelper.write(_out,get_file_transfer_irp_versions());
			}
			catch(FileTransferIRPSystem.GetFileTransferIRPVersions _ex0)
			{
				_out = handler.createExceptionReply();
				FileTransferIRPSystem.GetFileTransferIRPVersionsHelper.write(_out, _ex0);
			}
				break;
			}
			case 1: // get_file_transfer_irp_notifications_profile
			{
			try
			{
				java.lang.String _arg0=_input.read_string();
				_out = handler.createReply();
				ManagedGenericIRPConstDefs.MethodListHelper.write(_out,get_file_transfer_irp_notifications_profile(_arg0));
			}
			catch(FileTransferIRPSystem.GetFileTransferIRPNotificationsProfile _ex0)
			{
				_out = handler.createExceptionReply();
				FileTransferIRPSystem.GetFileTransferIRPNotificationsProfileHelper.write(_out, _ex0);
			}
			catch(ManagedGenericIRPSystem.InvalidParameter _ex1)
			{
				_out = handler.createExceptionReply();
				ManagedGenericIRPSystem.InvalidParameterHelper.write(_out, _ex1);
			}
			catch(ManagedGenericIRPSystem.OperationNotSupported _ex2)
			{
				_out = handler.createExceptionReply();
				ManagedGenericIRPSystem.OperationNotSupportedHelper.write(_out, _ex2);
			}
				break;
			}
			case 2: // file_download_indication
			{
			try
			{
				FileTransferIRPConstDefs.FileInfo[] _arg0=FileTransferIRPConstDefs.FileInfoListHelper.read(_input);
				_out = handler.createReply();
				FileTransferIRPConstDefs.ResultHelper.write(_out,file_download_indication(_arg0));
			}
			catch(FileTransferIRPSystem.FileDownloadIndication _ex0)
			{
				_out = handler.createExceptionReply();
				FileTransferIRPSystem.FileDownloadIndicationHelper.write(_out, _ex0);
			}
			catch(ManagedGenericIRPSystem.OperationNotSupported _ex1)
			{
				_out = handler.createExceptionReply();
				ManagedGenericIRPSystem.OperationNotSupportedHelper.write(_out, _ex1);
			}
			catch(FileTransferIRPSystem.InvalidFileInfoList _ex2)
			{
				_out = handler.createExceptionReply();
				FileTransferIRPSystem.InvalidFileInfoListHelper.write(_out, _ex2);
			}
				break;
			}
			case 3: // get_file_transfer_irp_operations_profile
			{
			try
			{
				java.lang.String _arg0=_input.read_string();
				_out = handler.createReply();
				ManagedGenericIRPConstDefs.MethodListHelper.write(_out,get_file_transfer_irp_operations_profile(_arg0));
			}
			catch(FileTransferIRPSystem.GetFileTransferIRPOperationsProfile _ex0)
			{
				_out = handler.createExceptionReply();
				FileTransferIRPSystem.GetFileTransferIRPOperationsProfileHelper.write(_out, _ex0);
			}
			catch(ManagedGenericIRPSystem.InvalidParameter _ex1)
			{
				_out = handler.createExceptionReply();
				ManagedGenericIRPSystem.InvalidParameterHelper.write(_out, _ex1);
			}
			catch(ManagedGenericIRPSystem.OperationNotSupported _ex2)
			{
				_out = handler.createExceptionReply();
				ManagedGenericIRPSystem.OperationNotSupportedHelper.write(_out, _ex2);
			}
				break;
			}
			case 4: // list_available_files
			{
			try
			{
				short _arg0=_input.read_short();
				TimeBase.UtcT _arg1=TimeBase.UtcTHelper.read(_input);
				TimeBase.UtcT _arg2=TimeBase.UtcTHelper.read(_input);
				FileTransferIRPConstDefs.FileInfoListHolder _arg3= new FileTransferIRPConstDefs.FileInfoListHolder();
				_out = handler.createReply();
				FileTransferIRPConstDefs.ResultHelper.write(_out,list_available_files(_arg0,_arg1,_arg2,_arg3));
				FileTransferIRPConstDefs.FileInfoListHelper.write(_out,_arg3.value);
			}
			catch(ManagedGenericIRPSystem.InvalidParameter _ex0)
			{
				_out = handler.createExceptionReply();
				ManagedGenericIRPSystem.InvalidParameterHelper.write(_out, _ex0);
			}
			catch(FileTransferIRPSystem.ListAvailableFiles _ex1)
			{
				_out = handler.createExceptionReply();
				FileTransferIRPSystem.ListAvailableFilesHelper.write(_out, _ex1);
			}
			catch(FileTransferIRPSystem.InvalidTimes _ex2)
			{
				_out = handler.createExceptionReply();
				FileTransferIRPSystem.InvalidTimesHelper.write(_out, _ex2);
			}
				break;
			}
		}
		return _out;
	}

	public String[] _all_interfaces(org.omg.PortableServer.POA poa, byte[] obj_id)
	{
		return ids;
	}
}
